up: microprocessors - microchip pics - pic assembly language  
Pic Assembly Language
Opcodes
What links here?
Byte-Oriented File Register Operations
MnemonicDescriptionFunction
ADDWFf,dAdd W and f (d) := (W) + (f)
ANDWFf,dAND W and f (d) := (W) AND (f)
CLRFfClear f (f) := 0
CLRW Clear WW :=0
COMFf,dComplement d := f NOT f
DECFf,dDecrement d := f - 1
DECFSZf,d Decrement f, skip if zero d := f - 1, skip if 0
INCFf,d Increment f d := f + 1
INCFSZf,d Increment f, skip if zero d := f + 1, skip if 0
IORWFf,d Inclusive OR W and f d := W OR f
MOVFf,d Move f d := f
MOVWFf Move W to f f := W
NOP No operation 
RLFf,d Rotate left f 
RRFf,d Rotate right f 
SUBWFf,d Subtract W from f d := f - W
SWAPFf,d Swap halves f f(0:3) ? f(4:7) ? d
XORWFf,d Exclusive OR W and f d := W .XOR. f
Bit-Oriented File Register Operations
MnemonicDescriptionFunction
BCF f,b Bit b in register f is clearedf(b) := 0
BSF f,b Bit b in register f is setf(b) := 1
BTFSC f,b test bit b of register f, skip next instruction if clear skip if f(b) = 0
BTFSS f,b test bit b of register f, skip next instruction if set skip if f(b) = 1
Literal and Control Operations
MnemonicDescriptionFunction
ADDLW kk Add literal to W (W) := kk + (W)
ANDLW kk AND literal and W (W) := kk AND (W)
CALL kkk Call subroutine TOS := PC + 1
PC := kk
PC<12:11> := (PCLATH<4:3>)
CLRWDT   Clear watchdog timer WDT (and Prescaler if assigned) := 0
GOTO kkk Goto address (k is nine bits) PC(9 bits) := kkk
IORLW kk Incl. OR literal and W WREG := kk OR WREG
MOVLW kk Move Literal to W WREG := kk
OPTION   Load OPTION register (1) OPTION Register := WREG
RETFIE   Return from Interrupt PC := TOS, GIE := 1
RETLW kk Return with literal in W WREG := kk, PC := TOS
RETURN   Return from subroutine PC := TOS
SLEEP   Go into Standby Mode WDT := 0, stop oscillator
SUBLW kk Subtract W from literal WREG := kk - WREG
TRIS r Tristate port r (1)I/O control reg r := WREG
XORLW kk Exclusive OR literal and W WREG := kk XOR WREG
f = rgister file address (0x00 to 0x7F)


W = working register (accumulator)
b = bit address within an 8-bit file register
k = literal field, constant data or label
x = don't care location
d = destination select
  • d = 0: store result in W
  • d = 1 : store result in f
PC = program counter
TO = time-out bit


PD = power-down bit



ADDWFf,dAdd W and f (d) := (W) + (f)



ANDWFf,dAND W and f (d) := (W) AND (f)



CLRFfClear f (f) := 0



CLRW Clear WW :=0




COMFf,dComplement d := f NOT f




DECFf,dDecrement d := f - 1




DECFSZf,d Decrement f, skip if zero d := f - 1, skip if 0




INCFf,d Increment f d := f + 1




INCFSZf,d Increment f, skip if zero d := f + 1, skip if 0




IORWFf,d Inclusive OR W and f d := W OR f




MOVFf,d Move f d := f




MOVWFf Move W to f f := W




NOP No operation 




RLFf,d Rotate left f 




RRFf,d Rotate right f 




SUBWFf,d Subtract W from f d := f - W




SUBWFf,d Subtract W from f d := f - W




SWAPFf,d Swap halves f f(0:3) ? f(4:7) ? d




XORWFf,d Exclusive OR W and f d := W .XOR. f




BCF f,b Bit b in register f is clearedf(b) := 0




BSF f,b Bit b in register f is setf(b) := 1




BTFSC f,b test bit b of register f, skip next instruction if clear skip if f(b) = 0




BTFSS f,b test bit b of register f, skip next instruction if set skip if f(b) = 1




ADDLW kk Add literal to W (W) := kk + (W)




ANDLW kk AND literal and W (W) := kk AND (W)




CALL kkk Call subroutine TOS := PC + 1
PC := kk
PC<12:11> := (PCLATH<4:3>)




CLRWDT   Clear watchdog timer WDT (and Prescaler if assigned) := 0




GOTO kkk Goto address (k is nine bits) PC(9 bits) := kkk




IORLW kk Incl. OR literal and W WREG := kk OR WREG




MOVLW kk Move Literal to W WREG := kk




OPTION   Load OPTION register (1) OPTION Register := WREG




RETFIE   Return from Interrupt PC := TOS, GIE := 1




RETLW kk Return with literal in W WREG := kk, PC := TOS




RETFIE   Return from Interrupt PC := TOS, GIE := 1




SLEEP   Go into Standby Mode WDT := 0, stop oscillator




SUBLW kk Subtract W from literal WREG := kk - WREG




TRIS r Tristate port r (1)I/O control reg r := WREG




XORLW kk Exclusive OR literal and W WREG := kk XOR WREG
microprocessors - microchip pics - pic assembly language - Opcodes
filename:microprocessors - microchip pics - pic assembly language - Opcodes
filename:microprocessors%20%2D%20microchip%20pics%20%2D%20pic%20assembly%20language%20%2D%20Opcodes
last edit:June 08 2019 21:11:28 (1793 days ago)
ct = 1714977491.000000 = May 06 2024 02:38:11
ft = 1560042688.000000 = June 08 2019 21:11:28
dt = 154934803.000000